package com.lkedu.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.lkedu.entity.CourseBean;
import com.lkedu.entity.UserBean;
import com.lkedu.service.CourseService;

/**
 * Servlet implementation class CourseServlet
 */
@WebServlet("/CourseServlet")
public class CourseServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;
	
	CourseService courseService= new CourseService();
	public void search(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		System.out.println("------------search----------");
		String keywords=request.getParameter("keywords");
		
		List<CourseBean> courseBeans=courseService.getCourses(keywords);
		request.setAttribute("courseBeans", courseBeans);
		request.getRequestDispatcher("course.jsp").forward(request, response);

	}
	

}
